home *** CD-ROM | disk | FTP | other *** search
- /*
- File: GenericDriverFamily.h
-
- Contains: Definitions and interfaces for Generic Driver family.
-
- Version: 1.0
-
- Written by: Erik Staats
-
- Copyright: © 1996, 1998 by Apple Computer, Inc., all rights reserved.
-
- File Ownership:
-
- DRI: Jay Lloyd
-
- Other Contact:
-
- Technology: FireWire
-
- Writers:
-
- (jkl) Jay Lloyd
-
- Change History (most recent first):
-
- <FW6> 8/6/98 jkl Include dependencies on other header files.
- <FW5> 1/15/98 jkl Update defines for new interfaces.
- <FW4> 1/4/98 EA Remove "implement this" comment for
- kGDFServiceIsLoadedUponDiscovery.
- <FW3> 10/22/96 ES Added driverRefNum to GDFDeviceEventData record.
- <FW2> 10/21/96 ES Filled in contains field.
- <FW1> 10/21/96 ES first checked in
-
- */
-
- #ifndef __GENERICDRIVERFAMILY__
- #define __GENERICDRIVERFAMILY__
-
- #ifndef __NAMEREGISTRY__
- #include <NameRegistry.h>
- #endif
-
- #ifndef __DRIVERSERVICES__
- #include <DriverServices.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- typedef struct OpaqueGDFDeviceEventRegistrationID* GDFDeviceEventRegistrationID;
- typedef struct OpaqueGDFDeviceID* GDFDeviceID;
-
- enum
- {
- kInvalidGDFDeviceEventRegistrationID = 0,
- kInvalidGDFDeviceID = 0
- };
-
- enum
- {
- kInvalidGDFEvent = 0,
- kGDFDeviceAddedEvent = 1,
- kGDFDeviceRemovedEvent = 2
- };
-
- typedef OSStatus (GDFExpertEntryPoint) (void);
- typedef GDFExpertEntryPoint *GDFExpertEntryPointPtr;
-
- struct GDFDeviceEventDataStruct
- {
- RegEntryID deviceRegEntryID; // Name Registry ID of device.
- DriverRefNum driverRefNum; // Driver ref num for device.
- OSType serviceType; // Service type for device.
- UInt32 deviceEvent; // Type of event that occured.
- GDFDeviceID gdfDeviceID; // GDF device ID of device.
- GDFDeviceEventRegistrationID
- gdfDeviceEventRegistrationID; // Registration ID for this event.
- UInt32 eventHandlerData; // Data for use by handler.
- };
- typedef struct GDFDeviceEventDataStruct
- GDFDeviceEventData,
- *GDFDeviceEventDataPtr;
-
- typedef OSStatus (GDFDeviceEventHandlerProc) (
- GDFDeviceEventDataPtr pGDFDeviceEventData);
- typedef GDFDeviceEventHandlerProc
- *GDFDeviceEventHandlerProcPtr;
-
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- // GDF service descriptor defs.
- //
-
- enum
- {
- kGDFServiceDescriptionSignature = 'gdfs'
- };
-
- enum
- {
- kInitialGDFServiceDescriptor = 0
- };
-
- enum
- {
- kGDFServiceIsLoadedUponDiscovery = (1 << 0) // Auto-load GDFService when discovered.
- };
-
- typedef UInt32 GDFServiceDescVersion;
- typedef UInt32 GDFServiceOSRunTimeOptions;
-
- struct GDFServiceTypeStruct
- {
- OSType gdfServiceName; // GDFService name.
- NumVersion version; // GDFService version number.
- OSType reserved; // Reserved area.
- };
- typedef struct GDFServiceTypeStruct
- GDFServiceType,
- *GDFServiceTypePtr;
-
- struct GDFServiceOSRunTimeStruct
- {
- GDFServiceOSRunTimeOptions gdfServiceRuntime; // Options for OS runtime.
- Str31 gdfServiceName; // GDFService's name to the OS
- UInt32 gdfServiceDescReserved[8]; // Reserved area
- };
- typedef struct GDFServiceOSRunTimeStruct
- GDFServiceOSRunTime,
- *GDFServiceOSRunTimePtr;
-
- struct GDFServiceDescriptionStruct
- {
- OSType gdfServiceDescSignature; // Signature field of this structure.
- GDFServiceDescVersion gdfServiceDescVersion; // Version of this data structure.
- GDFServiceType gdfServiceType; // Type of driver.
- GDFServiceOSRunTime gdfServiceOSRuntime; // OS runtime requirements of GDFService.
- };
- typedef struct GDFServiceDescriptionStruct
- GDFServiceDescription,
- *GDFServiceDescriptionPtr;
-
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Generic driver family services.
- //
-
- OSStatus GDFRegisterDeviceEventHandlerProc (
- OSType serviceType,
- UInt32 numEvents,
- UInt32 *eventTable,
- GDFDeviceEventHandlerProcPtr
- gdfDeviceEventHandler,
- UInt32 eventHandlerData,
- GDFDeviceEventRegistrationID
- *pGDFDeviceEventRegistrationID);
-
- OSStatus GDFUnregisterDeviceEventHandler (
- GDFDeviceEventRegistrationID
- gdfDeviceEventRegistrationID);
-
- OSStatus GDFRegisterFSSpecExpert (
- FSSpecPtr pExpertFSSpec);
-
- OSStatus GDFRegisterFSSpecResourceExpert (
- FSSpecPtr pExpertFSSpec,
- ResType expertResType,
- short expertResID);
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __GENERICDRIVERFAMILY__ */
-